import VueRouter from 'vue-router'

//引入组件
import Index from '../pages'
import Home from '../pages/home/home'
import Login from '../pages/login/login'
import Register from '../pages/register/register'
import Center from '../pages/center/center'
import Messages from '../pages/messages/list'
import Storeup from '../pages/storeup/list'
import News from '../pages/news/news-list'
import NewsDetail from '../pages/news/news-detail'
import xueshengList from '../pages/xuesheng/list'
import xueshengDetail from '../pages/xuesheng/detail'
import xueshengAdd from '../pages/xuesheng/add'
import jiaoshiList from '../pages/jiaoshi/list'
import jiaoshiDetail from '../pages/jiaoshi/detail'
import jiaoshiAdd from '../pages/jiaoshi/add'
import kechenghuodongList from '../pages/kechenghuodong/list'
import kechenghuodongDetail from '../pages/kechenghuodong/detail'
import kechenghuodongAdd from '../pages/kechenghuodong/add'
import kechengleixingList from '../pages/kechengleixing/list'
import kechengleixingDetail from '../pages/kechengleixing/detail'
import kechengleixingAdd from '../pages/kechengleixing/add'
import kechengbaomingList from '../pages/kechengbaoming/list'
import kechengbaomingDetail from '../pages/kechengbaoming/detail'
import kechengbaomingAdd from '../pages/kechengbaoming/add'
import kechengzhengmingList from '../pages/kechengzhengming/list'
import kechengzhengmingDetail from '../pages/kechengzhengming/detail'
import kechengzhengmingAdd from '../pages/kechengzhengming/add'
import huodongzhengshuList from '../pages/huodongzhengshu/list'
import huodongzhengshuDetail from '../pages/huodongzhengshu/detail'
import huodongzhengshuAdd from '../pages/huodongzhengshu/add'
import kechengxuefenList from '../pages/kechengxuefen/list'
import kechengxuefenDetail from '../pages/kechengxuefen/detail'
import kechengxuefenAdd from '../pages/kechengxuefen/add'
import zhengshuxuefenList from '../pages/zhengshuxuefen/list'
import zhengshuxuefenDetail from '../pages/zhengshuxuefen/detail'
import zhengshuxuefenAdd from '../pages/zhengshuxuefen/add'
import xueshengchengjiList from '../pages/xueshengchengji/list'
import xueshengchengjiDetail from '../pages/xueshengchengji/detail'
import xueshengchengjiAdd from '../pages/xueshengchengji/add'

const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
	return originalPush.call(this, location).catch(err => err)
}

//配置路由
export default new VueRouter({
	routes:[
		{
      path: '/',
      redirect: '/index/home'
    },
		{
			path: '/index',
			component: Index,
			children:[
				{
					path: 'home',
					component: Home
				},
				{
					path: 'center',
					component: Center,
				},
				{
					path: 'messages',
					component: Messages
				},
				{
					path: 'storeup',
					component: Storeup
				},
				{
					path: 'news',
					component: News
				},
				{
					path: 'newsDetail',
					component: NewsDetail
				},
				{
					path: 'xuesheng',
					component: xueshengList
				},
				{
					path: 'xueshengDetail',
					component: xueshengDetail
				},
				{
					path: 'xueshengAdd',
					component: xueshengAdd
				},
				{
					path: 'jiaoshi',
					component: jiaoshiList
				},
				{
					path: 'jiaoshiDetail',
					component: jiaoshiDetail
				},
				{
					path: 'jiaoshiAdd',
					component: jiaoshiAdd
				},
				{
					path: 'kechenghuodong',
					component: kechenghuodongList
				},
				{
					path: 'kechenghuodongDetail',
					component: kechenghuodongDetail
				},
				{
					path: 'kechenghuodongAdd',
					component: kechenghuodongAdd
				},
				{
					path: 'kechengleixing',
					component: kechengleixingList
				},
				{
					path: 'kechengleixingDetail',
					component: kechengleixingDetail
				},
				{
					path: 'kechengleixingAdd',
					component: kechengleixingAdd
				},
				{
					path: 'kechengbaoming',
					component: kechengbaomingList
				},
				{
					path: 'kechengbaomingDetail',
					component: kechengbaomingDetail
				},
				{
					path: 'kechengbaomingAdd',
					component: kechengbaomingAdd
				},
				{
					path: 'kechengzhengming',
					component: kechengzhengmingList
				},
				{
					path: 'kechengzhengmingDetail',
					component: kechengzhengmingDetail
				},
				{
					path: 'kechengzhengmingAdd',
					component: kechengzhengmingAdd
				},
				{
					path: 'huodongzhengshu',
					component: huodongzhengshuList
				},
				{
					path: 'huodongzhengshuDetail',
					component: huodongzhengshuDetail
				},
				{
					path: 'huodongzhengshuAdd',
					component: huodongzhengshuAdd
				},
				{
					path: 'kechengxuefen',
					component: kechengxuefenList
				},
				{
					path: 'kechengxuefenDetail',
					component: kechengxuefenDetail
				},
				{
					path: 'kechengxuefenAdd',
					component: kechengxuefenAdd
				},
				{
					path: 'zhengshuxuefen',
					component: zhengshuxuefenList
				},
				{
					path: 'zhengshuxuefenDetail',
					component: zhengshuxuefenDetail
				},
				{
					path: 'zhengshuxuefenAdd',
					component: zhengshuxuefenAdd
				},
				{
					path: 'xueshengchengji',
					component: xueshengchengjiList
				},
				{
					path: 'xueshengchengjiDetail',
					component: xueshengchengjiDetail
				},
				{
					path: 'xueshengchengjiAdd',
					component: xueshengchengjiAdd
				},
			]
		},
		{
			path: '/login',
			component: Login
		},
		{
			path: '/register',
			component: Register
		},
	]
})
